package com.ttl.bc.ic.stkissue.action;



import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

import com.ttl.bc.ic.stkissue.db.BCStkIssueDDBO;

import com.ttl.common.util.CommonUtils;

public class BCStkIssueDDAction extends DispatchAction {
	
	public ActionForward blank(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) 
			throws Exception {
				
		String user  = (String)request.getSession().getAttribute("userName");										
		//String docNo = CommonUtils.getMaxStkIssueDocNo("DD");
		
		
		request.getSession().setAttribute("userName", user);
		//request.getSession().setAttribute("docNo", docNo);		
		
		System.out.println(CommonUtils.getDateTimeForStamp()+" #user:"+user+" #use :BCStkIssueDDAction #mode :blank");
		
		return mapping.findForward("blank");
	}		
	
	public ActionForward showFind(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) 
			throws Exception {

		String user 	 = (String)request.getSession().getAttribute("userName");
		System.out.println(CommonUtils.getDateTimeForStamp()+" #user:"+user+" #use :BCStkIssueDDAction #mode :show");		
		
		@SuppressWarnings("unused")
		BCStkIssueDDBO bo = new BCStkIssueDDBO();														
//		ArrayList results = (ArrayList)bo.find(request);				
				
//		request.getSession().setAttribute("results", results);		
		request.getSession().setAttribute("userName", user);
		
		return mapping.findForward("success_showFind");
	}

/*	public ActionForward add(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) 
			throws Exception {
		
		String user 	 = (String)request.getSession().getAttribute("userName");
		System.out.println(CommonUtils.getDateTimeForStamp()+" #user:"+user+" #use :BCStkIssueDDAction #mode :add");
		
		BCStkIssue2DDBO bo = new BCStkIssue2DDBO();						
		if (bo.add(form, request, response)==true) {							
			return mapping.findForward("success_add");
		}else {
			//ทำ map กับการ fail_add
			return mapping.findForward("fail_add");
		}
	}*/		
}
